package com.taotao.openapi2.controller;

import com.taotao.openapi2.common.RespData;
import com.taotao.openapi2.model.po.Area;
import com.taotao.openapi2.service.AreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;
import org.noear.solon.core.handle.MethodType;
import org.noear.solon.validation.annotation.Valid;


@Valid
@Slf4j
@Api(tags = "地区")
@Controller
@Mapping("/area")
public class AreaController {
    @Inject
    private AreaService areaService;

    @ApiOperation(value = "get演示1", notes = "")
    @Mapping(value = "/getById", method = MethodType.GET)
    public RespData<Area> getById(@ApiParam("id") @Param(value = "id", defaultValue = "110100") Long id) {
        return RespData.successResp(areaService.getById(id));
    }


}